using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_DENTALLABMap : EntityTypeConfiguration<SO_DENTALLAB>
    {
        public SO_DENTALLABMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.PHYSICIAN });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.PATIENT__)
                .HasMaxLength(6);

            this.Property(t => t.PATIENT)
                .HasMaxLength(110);

            this.Property(t => t.GENDER)
                .HasMaxLength(10);

            this.Property(t => t.SHAPE)
                .HasMaxLength(35);

            this.Property(t => t.METAL)
                .HasMaxLength(35);

            this.Property(t => t.PHYSICIAN)
                .IsRequired()
                .HasMaxLength(35);

            this.Property(t => t.INSTRUCTION)
                .HasMaxLength(200);

            this.Property(t => t.RESULT)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("SO_DENTALLAB");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.PATIENT__).HasColumnName("PATIENT_#");
            this.Property(t => t.PATIENT).HasColumnName("PATIENT");
            this.Property(t => t.AGE).HasColumnName("AGE");
            this.Property(t => t.GENDER).HasColumnName("GENDER");
            this.Property(t => t.SHAPE).HasColumnName("SHAPE");
            this.Property(t => t.METAL).HasColumnName("METAL");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.FIRST_TRIAL_DATE).HasColumnName("FIRST_TRIAL_DATE");
            this.Property(t => t.SECOND_TRIAL_DATE).HasColumnName("SECOND_TRIAL_DATE");
            this.Property(t => t.FINAL_TRIAL_DATE).HasColumnName("FINAL_TRIAL_DATE");
            this.Property(t => t.PHYSICIAN).HasColumnName("PHYSICIAN");
            this.Property(t => t.INSTRUCTION).HasColumnName("INSTRUCTION");
            this.Property(t => t.RESULT).HasColumnName("RESULT");
        }
    }
}
